import request from '@/utils/iasRequest'
import common from '@/api/active-global'

const basePath = common.basePath

export function batchActiveItemAgree(val) {
  return request({
    url: basePath + '/batchActiveItemAgree',
    method: 'post',
    data: val
  })
}

export function batchActiveItemReject(val, changeType, rejectRemark) {
  return request({
    url: basePath + '/batchActiveItemReject',
    method: 'post',
    data: { ids: val, changeType, rejectMsg: rejectRemark }
  })
}

export function batchActiveItem(val) {
  return request({
    url: basePath + '/batchActiveItem',
    method: 'post',
    data: val
  })
}

export function batchModifyItemType(val) {
  return request({
    url: basePath + '/batchModifyItemType',
    method: 'post',
    data: val
  })
}

export function uploadActivItemExcel(data, changeType) {
  return request({
    url: basePath + '/uploadActiveItemExcel?changeType=' + changeType,
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'put',
    timeout: 600000,
    data
  })
}

export function batchValidate(val) {
  return request({
    url: basePath + '/batchValidate',
    method: 'post',
    timeout: 600000,
    data: val
  })
}

export function get(val) {
  return request({
    url: basePath + '/get?id=' + val,
    method: 'get'
  })
}

export function addOrUpdate(val, method) {
  return request({
    url: basePath + '/' + method,
    method: 'post',
    data: val
  })
}

export function batchAddItemInfo(val, method) {
  return request({
    url: basePath + '/' + method,
    method: 'post',
    data: val
  })
}

export function batchUpdateFilePath(val) {
  return request({
    url: basePath + '/batchUpdateFilePath',
    method: 'post',
    data: val
  })
}

export function submitBPMS(val) {
  return request({
    url: basePath + '/submitBPMS',
    method: 'post',
    data: val
  })
}

export function queryItemByItemNbr(val) {
  return request({
    url: basePath + '/queryActivateItemByItemNbr',
    method: 'post',
    data: val
  })
}

